home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-07-27 | 6.8 KB | 159 lines | [TEXT/ttxt] |
- This is a sample driver for an asynchronous hardware device - in this
- case, an NCR 8250 PCI interface card that uses an NCR 53C825 SCSI
- interface chip. The driver sources are separated into three generally
- independent areas: device driver mainline, hardware-specific interface,
- and utilities for a number of driver services, including the Expansion
- Bus Manager and the Name Registry. The driver illustrates I/O request
- management, DMA setup and operation, device configuration. It also
- shows one approach to debugging asynchronous applications; but
- probably not the best.
-
- Although this is a working driver, it has received only a bare minimum
- of testing (as shown by the TestDriver utility). It is not intended as
- a sample for programming the NCR 8250 PCI interface card. Also, it
- should not be used as a basis for SCSI driver development: SCSI device
- drivers should use the SCSI Manager interface, and SCSI host bus
- adaptors should be written as SIMS.
-
- There are "quick-and-dirty" ports of two SCSI test utilities that
- have not been completely moved to the NCR environment (in particular,
- some dialog and menu options are present that don't make sense for
- the NCR driver. These are probably unnecessary for others. The
- asynchronous test, however, might be useful for driver stress testing.
-
- Build instructions (A5 release and later)
-
- 1. Copy the Framework NCR Sample folder from the DDK CD to the
- top-level of your system disk (or another disk if appropriate).
- 2. Copy the PCICIncludes folder from the DDK CD to the top-level
- of the disk you chose in step 1 above.
- 3. Copy the PCILibraries folder from the DDK CD to the top-level
- of the disk you chose in step 1 above.
- 4. If you want to use the logging functions, copy the LogLibrary
- shared library to the Extensions folder, and add the dcmd to the
- MacsBug Prefs file. If you don't, disable LogLibrary and edit out
- any calls that are not resolved. The LogLibrary is in the debugging
- utilities folder.
-
- This disk will have the following general organization:
- Disk
- : Framework NCR Sample (folder)
- : NCR_DriverProject (folder)
- : NCR_TestAppProject (folder)
- : PCICincludes
- : PCILibraries
-
- 4. Copy the UserStartup•PCI file from the FrameWork NCR Sample folder
- on the DDK CD to the Preferences folder of your System boot disk.
- Edit the UserStartup•PCI file to define the {PCICIncludes} and
- {PCILibraries} MPW exported variables.
-
- 5. To build under MetroWerks, you may need to reset the path names
- in the Preferences dialog under the AccessPaths sub-heading. You need
- to do this for both projects (NCRDriver.Δ and TestDriver.Δ). You may
- also need to "refresh" the MetroWerks project by manually removing
- libraries and adding fresh copies.
-
- 6. You should then be able to build the MPW version of the driver. The
- test application currently only builds under Metrowerks, but conversion
- to MPW should prove straightforward.
-
- Changes since the A2 release
-
- •• Framework driver
- • The Framework driver was extensively revised (see the comments
- in DoDriverIO.c for details). This includes folder reorganization
- and other mechanical changes required by the changes to headers
- and libraries.
- • The Framework driver now supports supersede/replace, but this
- has not been tested by actually replacing a driver.
- • Corrected an error where it only did I/O cycles to base address
- zero. This works as long as the NCR card was the only external
- device. Now, the I/O cycle base address is retrieved from the
- Name Registry.
- • Corrected a potential error by adding SynchonizeIO calls in the
- hardware-access routines. Also, marked some variables with
- the "volatile" C keyword to prevent over-optomization.
- • Added simple support for PrepareMemoryForIO. This is limited
- to a single physical page, but does illustrate how the function
- is to be used.
- • The driver stores the Initiator ID in the Name Registry. A bug
- in an early engineering build of A5 prevented use of the NVRAM
- modifier and it was disabled - the adventurous may re-enable
- the code.
- • Added secondary interrupt handling, but this does not work
- on the current A5.
- • The "fetch debug information" private Status call was removed.
- The driver stores a pointer to its globals in the name registry
- and the test application fetches the information from there.
-
- •• Test application
- • Minor changes to track changes in the libraries and headers.
- • Some minor reorganization and changes to display routines.
- • Rewrote the PCI bus interface library.
- • Updated for Code Warrior 1.2
- • Added an MPW Makefile.
-
- Status (December 23, 1994):
-
- • Driver installs, but fails to run successfully.
- • Both the MetroWerks and MPW versions compile and install.
- • The MetroWerks and MPW versions of the test application
- fail in different ways.
- • Dependencies: MPW from ETO 15, MetroWerks Code Warrior 1.2 (GM).
-
- Status (January 20, 1995)
- • Runs, more or less, but fails if asynchronous I/O is attempted.
- • Can't successfully stop processing using KillIO.
- • NVRAM algorithm needs to be tested.
-
- Status (January 23, 1995)
- • Fixed the NVRAM algorithm - dumb bug.
-
- Status (February 5, 1995)
- • Updated name registry routines.
- • Reimplemented PrepareMemoryForIO.
- • Implemented SecondaryInterrupts
- • Implemented watchdog timeouts (but, do they work?)
- • Removed a lot of debug code: relying on the log library.
- • Asynchronous requests randomly fail.
-
- Status (Feburary 8, 1995)
- • Redesigned the external programming interface: SCSI requests now
- use PBRead or PBWrite, with the SCSI-specific parameters passed in
- a structure that is referenced by the ioMisc field in the IOParam
- record. This will be compatible with future Mac operating systems that
- will not support DMA from user buffers defined in PBControl calls.
- • Asynch I/O now seems to work. Maybe PBRead was the answer.
- • There's a memory leak somewhere.
-
- Status (March 10, 1995 1.0A8 system release)
- • Added PrepareMemoryForIO support, removed a lot of work-arounds
- for earlier versions.
- • Added AAPL,address support.
- • Some strange bugs remain; but these may be specific to the
- NCI script.
- • The memory leak seems to have disappeared.
-
- Status (March 13, 1995 1.0A8 system release, "beta candidate")
- • Completely rewrote PrepareMemoryForIO. Gave it minimal testing.
- • Removed several test applications: now using only MiniTest.
- • Much PrepareMemoryForIO testing remains to be done.
-
- Status (March 22, 1995 1.0b1)
- • Another PrepareMemoryForIO rewrite -- for clarity this time
- • Chasing a memory leak. Not necessarily mine.
- • The MetroWerks version links against the logging shared library,
- which should be loaded into the Extensions folder on the PCI
- machine. The MPW version compiles against the LogLibrary source,
- because I'm too lazy (and afraid) to change the Makefile.
-
- Status (April 5, 1995 1.0b2, 1.0b3 engineering build)
- • Debugged at long last -- or so I hope.
-
- Programmed by
-
- Martin Minow
- Apple Computer Inc.
- Developer Technical Support
-